<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/include/lwip/memp.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('memp_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">memp.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="memp__std_8h.html">lwip/priv/memp_std.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="memp__priv_8h.html">lwip/priv/memp_priv.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stats_8h.html">lwip/stats.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga92fc8c29d0e2654f2a2ecc43b2b7fb13"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mempool.html#ga92fc8c29d0e2654f2a2ecc43b2b7fb13">LWIP_MEMPOOL_PROTOTYPE</a>(name)&#160;&#160;&#160;extern const struct <a class="el" href="structmemp__desc.html">memp_desc</a> memp_ ## name</td></tr>
<tr class="separator:ga92fc8c29d0e2654f2a2ecc43b2b7fb13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5b1fb3ce7942432d87cc948b1c5ed6cb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mempool.html#ga5b1fb3ce7942432d87cc948b1c5ed6cb">LWIP_MEMPOOL_DECLARE</a>(name,  num,  size,  desc)</td></tr>
<tr class="separator:ga5b1fb3ce7942432d87cc948b1c5ed6cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga60b51c06d276f525b35d8b7abd4dcb41"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mempool.html#ga60b51c06d276f525b35d8b7abd4dcb41">LWIP_MEMPOOL_INIT</a>(name)&#160;&#160;&#160;<a class="el" href="memp__priv_8h.html#a6416303426d05526bed33f241fa6ecd7">memp_init_pool</a>(&amp;memp_ ## name)</td></tr>
<tr class="separator:ga60b51c06d276f525b35d8b7abd4dcb41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e2498f6c17746c1fe7153de5f7f275a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mempool.html#ga5e2498f6c17746c1fe7153de5f7f275a">LWIP_MEMPOOL_ALLOC</a>(name)&#160;&#160;&#160;<a class="el" href="memp__priv_8h.html#a348c83ee972f1edf7296a1cdf1d75f22">memp_malloc_pool</a>(&amp;memp_ ## name)</td></tr>
<tr class="separator:ga5e2498f6c17746c1fe7153de5f7f275a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa43d114dd702fbd8f1db18474ea93a04"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mempool.html#gaa43d114dd702fbd8f1db18474ea93a04">LWIP_MEMPOOL_FREE</a>(name,  x)&#160;&#160;&#160;<a class="el" href="memp__priv_8h.html#a62f8c3c907743e34eee3cdac7fa1eaa5">memp_free_pool</a>(&amp;memp_ ## name, (x))</td></tr>
<tr class="separator:gaa43d114dd702fbd8f1db18474ea93a04"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a85a164b1f7764951cc685ea525114e57"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a> </td></tr>
<tr class="separator:a85a164b1f7764951cc685ea525114e57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9693e5b1ac2c6b9c0e7870522d45efa2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="memp_8h.html#a9693e5b1ac2c6b9c0e7870522d45efa2">memp_init</a> (void)</td></tr>
<tr class="separator:a9693e5b1ac2c6b9c0e7870522d45efa2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b00593d086313c267b54a976bf67aa5"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="memp_8h.html#a2b00593d086313c267b54a976bf67aa5">memp_malloc</a> (<a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a> type)</td></tr>
<tr class="separator:a2b00593d086313c267b54a976bf67aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecd94926b7c2a0e23ae195f4ae97581f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="memp_8h.html#aecd94926b7c2a0e23ae195f4ae97581f">memp_free</a> (<a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a> type, void *<a class="el" href="structmem.html">mem</a>)</td></tr>
<tr class="separator:aecd94926b7c2a0e23ae195f4ae97581f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Memory pool API</p>
<p>lwIP internal memory pools (do not use in application code) This file is deliberately included multiple times: once with empty definition of LWIP_MEMPOOL() to handle all includes and multiple times to build up various lists of mem pools. </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a85a164b1f7764951cc685ea525114e57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85a164b1f7764951cc685ea525114e57">&#9670;&nbsp;</a></span>memp_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aecd94926b7c2a0e23ae195f4ae97581f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecd94926b7c2a0e23ae195f4ae97581f">&#9670;&nbsp;</a></span>memp_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void memp_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>mem</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Put an element back into its pool.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the pool where to put mem </td></tr>
    <tr><td class="paramname">mem</td><td>the memp element to free </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9693e5b1ac2c6b9c0e7870522d45efa2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9693e5b1ac2c6b9c0e7870522d45efa2">&#9670;&nbsp;</a></span>memp_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void memp_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initializes lwIP built-in pools. Related functions: memp_malloc, memp_free</p>
<p>Carves out memp_memory into linked lists for each pool-type. </p>

</div>
</div>
<a id="a2b00593d086313c267b54a976bf67aa5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b00593d086313c267b54a976bf67aa5">&#9670;&nbsp;</a></span>memp_malloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* memp_malloc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="memp_8h.html#a85a164b1f7764951cc685ea525114e57">memp_t</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get an element from a specific pool.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the pool to get an element from</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to the allocated memory or a NULL pointer on error </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b0856f6b0d80ccb263b2f415c91f9e17.html">include</a></li><li class="navelem"><a class="el" href="dir_4e6b3cf33a61b6caac9c8ac30c866f37.html">lwip</a></li><li class="navelem"><a class="el" href="memp_8h.html">memp.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
